﻿@model CmsMvcPartialAdministrationModel

@{
    ResFile = "cms_Pages";
}

<fieldset class="b-form">
    <ol class="b-form__rows ul-reset g-clear">        
        <li class="b-form__row g-clear">            
            <label>@_("Controller"):</label>&nbsp;
            @if (string.IsNullOrWhiteSpace(Model.PartialAdministrationViewName))
            {
                @Model.ActionController
                <input class="text" type="hidden" name="@Html.GetClientNameForAdminViewElement(Model.PageControlId, "ActionController")" value="@Model.ActionController" />
            }
            else
            {            
                <input type="hidden" name="@Html.GetClientNameForAdminViewElement(Model.PageControlId, "ActionController")" value="@Model.ActionController" />
            }
        </li>
        <li class="b-form__row g-clear">            
            <label>@_("Action"):</label>&nbsp;
            @if (string.IsNullOrWhiteSpace(Model.PartialAdministrationViewName))
            {
                @Model.ActionName
                <input class="text" type="hidden" name="@Html.GetClientNameForAdminViewElement(Model.PageControlId, "ActionName")" value="@Model.ActionName" />
            }
            else
            {            
            <input type="hidden" name="@Html.GetClientNameForAdminViewElement(Model.PageControlId, "ActionName")" value="@Model.ActionName" />
            }
        </li>
        @if (!string.IsNullOrWhiteSpace(Model.PartialAdministrationViewName))
        {
        <li class="g-clear">
            <input type="hidden" name="@Html.GetClientNameForAdminViewElement(Model.PageControlId, "PartialModelType")" value="@Model.PartialModelType" />
            <div>
                @Html.Partial(Model.PartialAdministrationViewName, new { PageControlId = Model.PageControlId, Model = Model.PartialViewModel }.ToExpando())
            </div>
        </li>
        }
        else if (!string.IsNullOrEmpty(Model.PartialModelType))
        {
            <li class="b-form__row g-clear">
            <input type="hidden" name="@Html.GetClientNameForAdminViewElement(Model.PageControlId, "PartialModelType")" value="@Model.PartialModelType" />
            <div class="b-form_inner-container">
                @Html.Partial("DefaultPageControlModelView", Model.GetPartialModelTypeParameters())
            </div>
            </li>
        }
    </ol>
</fieldset>